package cn.com.gainfo.bktas.dao;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.sql.DataSource;

import cn.com.gainfo.bktas.vo.LogsVO;
import cn.yzyue.base.dao.AbstractDAO;
import cn.yzyue.base.tools.db.DB;
import cn.yzyue.base.tools.db.SQL;
import cn.yzyue.base.vo.VO;

public class LogsDAO extends AbstractDAO {
	
	private static SimpleDateFormat sdf14 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	@Override
	public boolean add(DataSource dataSource, VO logs){
		LogsVO vo = (LogsVO)logs;
		String sql = "insert into logs(datetime,merchno,userid,action,remark) values(";
		sql += "'" + sdf14.format(new Date()) + "','" + vo.getMerchno() + "','" + vo.getUserid() + "',";
		sql += "'" + vo.getAction() + "','" + vo.getRemark() + "')";
		return DB.alter(dataSource, sql);
	}

	@Override
	public List find(DataSource dataSource, SQL sql, int page) {
		// TODO Auto-generated method stub
		return super.find(dataSource, sql, page);
	}

	
	
}
